use "${clean}analysis.dta", clear

keep if south == 1
keep if year < 1900

//standardizing variables
egen birth_county_surban = std(birth_county_urban_percent)
egen birth_county_srugged = std(birth_county_ruggedness)
egen birth_county_spostoffice = std(birth_county_postoffice_area)
egen sborn = std(born)

// creating a variable to keep the sample constant
cap drop sample
gen sample = 1
foreach var of varlist $county_bcontrols $life_controls {
	replace sample = . if `var' == .
}
keep if sample == 1


// collapsing
collapse (count) numspeech = singular, by(year)


// graphing
twoway ///
	(scatteri 125 1865 125 1876, fcolor("${orange}") finten(inten10) recast(area)) ///
	(scatteri 125 1861 125 1865, fcolor("${orange}") finten(inten50) recast(area)) ///
	(bar numspeech year, fcolor("${blue}") lcolor(gs1) ) ///
	, legend(off) ///
	xlab(1852(4)1900) ///
	ylab(0(25)125, glcolor(gs15)) ///
	ytitle("Number of Statements", size(medsmall)) xtitle(Year, size(medsmall) ) ///
	text(120 1870.5 "Reconstruction", size(medsmall)) ///
	text(120 1863 "Civil", size(medsmall)) ///
	text(112.5 1863 "War", size(medsmall)) ///
	scheme(lean2) 	
graph export "${output}FigS9_histogram_southerners.pdf", as(pdf) replace
